package com.coscon.model.api;

/**
 * 响应状态码
 * @author 409390047@qq.com
 */
public enum ResponseCode {//响应状态码
    OK(200,"OK"),
    BAD_REQUEST(400,"BAD_REQUEST"),
    UNAUTHORIZED(401,"UNAUTHORIZED"),
    FORBIDDEN(403,"FORBIDDEN"),
    NOT_FOUND(404,"NOT_FOUND"),
    INTERNAL_SERVER_ERROR(500,"INTERNAL_SERVER_ERROR"),


    FAIL(1,"失败！"),
    SUCCESS(0,"成功"),
    ERROR(1,"失败！"),
    //业务的错误状态码
    TOKEN_INVALID(                                  10000,"token失效，请重新登录！"),
    TOKEN_ERROR(                                    10001,"token错误！"),
    TOKEN_NULL(                                     10002,"token不能为空！"),
    ACCOUNT_NEED_CHANGE_PASSWORD_ERROR(             10003,"请修改默认密码！"),
    ACCOUNT_EXPIRED_ERROR(                          10004,"账号过期！"),
    ACCOUNT_BAD_CREDENTIALS_ERROR(                  10005,"账号密码错误！"),
    ACCOUNT_CREDENTIALS_EXPIRED_ERROR(              10006,"密码过期！"),
    ACCOUNT_DISABLED_ERROR(                         10007,"账号不可用！"),
    ACCOUNT_INTERNAL_AUTHENTICATION_SERVICE_ERROR(  10008,"用户不存在！"),
    ACCOUNT_LOCKED_ERROR(                           10009,"账号锁定！"),
    ACCESS_LIMIT_ERROR(                             10014,"触发AccessLimit，请不要访问太频繁"),
    IP_LIMIT_ERROR(                                 10015,"触发IP限制规则，您已被禁止访问!"),
    UNKNOWN_ACCOUNT(                                10016,"账号不存在或者无效"),
    EXECUTE_DENIED(                                 10017,"exec禁止执行/execute denied!"),
    SYSTEM_SECURITY_MANAGER_DENIED(                 10018,"System.setSecurityManager denied!"),
    ;

    private final int code;
    private final String msg;

    private ResponseCode(int code,String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }





}

